﻿<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-osx;$(NetCoreAppCurrent)-ios;$(NetCoreAppCurrent)-tvos;$(NetCoreAppCurrent)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.SystemNetPing_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
    <IsApplePlatform Condition="'$(TargetPlatformIdentifier)' == 'osx' or '$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'tvos'">true</IsApplePlatform>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
    <Compile Include="System\Net\NetworkInformation\IPStatus.cs" />
    <Compile Include="System\Net\NetworkInformation\Ping.cs" />
    <Compile Include="System\Net\NetworkInformation\PingCompletedEventArgs.cs" />
    <Compile Include="System\Net\NetworkInformation\PingException.cs" />
    <Compile Include="System\Net\NetworkInformation\PingOptions.cs" />
    <Compile Include="System\Net\NetworkInformation\PingReply.cs" />
    <!-- Common -->
    <Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
             Link="Common\DisableRuntimeMarshalling.cs" />
    <Compile Include="$(CommonPath)System\Obsoletions.cs"
             Link="Common\System\Obsoletions.cs" />
    <!-- System.Net Common -->
    <Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.cs"
             Link="Common\System\Net\SocketProtocolSupportPal.cs" />
  </ItemGroup>

  <ItemGroup Condition="('$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows')">
    <Compile Include="System\Net\NetworkInformation\IcmpV4MessageConstants.cs" />
    <Compile Include="System\Net\NetworkInformation\IcmpV6MessageConstants.cs" />
    <Compile Include="System\Net\NetworkInformation\Ping.RawSocket.cs" />
    <!-- System.Net Common -->
    <Compile Include="$(CommonPath)System\Net\RawSocketPermissions.cs"
             Link="Common\System\Net\RawSocketPermissions.cs" />
    <Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.Unix.cs"
             Link="Common\System\Net\SocketProtocolSupportPal.Unix.cs" />
    <Compile Include="$(CommonPath)System\Net\NetworkInformation\UnixCommandLinePing.cs"
             Link="Common\System\Net\NetworkInformation\UnixCommandLinePing.cs" />
    <!-- Interop -->
    <Compile Include="$(CommonPath)Interop\Unix\Interop.DefaultPathBufferSize.cs"
             Link="Common\Interop\Unix\Interop.DefaultPathBufferSize.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
             Link="Common\Interop\Unix\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
             Link="Common\Interop\Unix\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Close.cs"
             Link="Common\Interop\Unix\System.Native\Interop.Close.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Socket.cs"
             Link="Common\Interop\Unix\System.Native\Interop.Socket.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.SocketAddress.cs"
             Link="Common\Interop\Unix\System.Native\Interop.SocketAddress.cs" />
    <Compile Include="$(CommonPath)System\Text\ValueUtf8Converter.cs"
             Link="Common\System\Text\ValueUtf8Converter.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(IsApplePlatform)' != 'true'">
    <Compile Include="System\Net\NetworkInformation\Ping.Unix.cs" />
    <Compile Include="System\Net\NetworkInformation\Ping.PingUtility.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(IsApplePlatform)' == 'true'">
    <Compile Include="System\Net\NetworkInformation\Ping.OSX.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="System\Net\NetworkInformation\Ping.Windows.cs" />
    <!-- System.Net Common -->
    <Compile Include="$(CommonPath)System\Net\IPAddressParserStatics.cs"
                 Link="Common\System\Net\IPAddressParserStatics.cs" />
    <Compile Include="$(CommonPath)System\Net\IPEndPointExtensions.cs"
             Link="Common\System\Net\IPEndPointExtensions.cs" />
    <Compile Include="$(CommonPath)System\Net\SocketAddressPal.Windows.cs"
             Link="Common\System\Net\SocketAddressPal.Windows.cs" />
    <Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.Windows.cs"
             Link="Common\System\Net\SocketProtocolSupportPal.Windows.cs" />
    <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeLocalAllocHandle.cs"
             Link="Common\Microsoft\Win32\SafeHandles\SafeLocalAllocHandle.cs" />
    <!-- Interop -->
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
             Link="Common\Interop\Windows\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\IpHlpApi\Interop.ErrorCodes.cs"
             Link="Common\Interop\Windows\IpHlpApi\Interop.ErrorCodes.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\IpHlpApi\Interop.ICMP.cs"
             Link="Common\Interop\Windows\IpHlpApi\Interop.ICMP.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.closesocket.cs"
             Link="Common\Interop\Windows\WinSock\Interop.closesocket.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.WSASocketW.cs"
             Link="Common\Interop\Windows\WinSock\Interop.WSASocketW.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.WSAStartup.cs"
             Link="Common\Interop\Windows\WinSock\Interop.WSAStartup.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.SocketConstructorFlags.cs"
             Link="Common\Interop\Windows\WinSock\Interop.SocketConstructorFlags.cs" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="Microsoft.Win32.Primitives" />
    <Reference Include="System.ComponentModel.EventBasedAsync" />
    <Reference Include="System.ComponentModel.Primitives" />
    <Reference Include="System.Diagnostics.Tracing" />
    <Reference Include="System.Memory" />
    <Reference Include="System.Net.NameResolution" />
    <Reference Include="System.Net.Primitives" />
    <Reference Include="System.Net.Sockets" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.Runtime.InteropServices" />
    <Reference Include="System.Threading" />
    <Reference Include="System.Threading.ThreadPool" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
    <Reference Include="System.Collections.Specialized" />
    <Reference Include="System.Diagnostics.Process" />
  </ItemGroup>

</Project>
